import {
	getList
} from '@/static/js/consult';
export default {
	data() {
		return {
			tileList: [{
				name: '问题库',
				url: '/library/problem/index/index',
				icon: '/static/img/index/icon_1.png',
				type: 0
			}, {
				name: '税收法规',
				url: '/law/tax/index/index',
				icon: '/static/img/index/icon_3.png',
				type: 0
			}, {
				name: '会计法规',
				url: '/law/acct/index/index',
				icon: '/static/img/index/icon_6.png',
				type: 0
			}, {
				name: '企服',
				url: '/enterpriseServer/index/index',
				icon: '/static/img/index/icon_5.png',
				type: 1
			}, {
				name: '优惠政策',
				url: '/law/dis/index/index',
				icon: '/static/img/index/icon_7.png',
				type: 0
			}, {
				name: '模板大全',
				url: '/pages/model/graduate/index',
				icon: '/static/img/index/icon_2.png',
				type: 0
			},
			{
				name: '财税工具',
				url: '/tools/index/index',
				icon: '/static/img/index/icon_4.png',
				type: 0
			}
			], //tools工具
			consultList: [], //资讯列表
		}
	},
	methods: {
		//请求资讯列表
		getConsultList() {
			getList({
				page: 1,
				pagesize: 10,
			}).then(res => {
				if (res.code == 1) {
					this.consultList = res.data;
				}
			})
		},

		//去资讯详情
		goConsultDetails(e) {
			uni.navigateTo({
				url: '../consult/consultDetails?id=' + e.id
			})
		},

		//跳转
		goTile(item) {
			if (item.type == 1) {
				uni.switchTab({
					url: item.url
				})
			} else {
				uni.navigateTo({
					url: item.url
				})
			}
		},
		go() {
			uni.navigateTo({
				url: '/pages/model/today/today'
			})
		},
	},
	onShow() {
		this.getConsultList()
	},
	onLoad(e) {

	},
}